/*******************************************************************************
 * The MOSES project, model based software engineering of networked embedded systems.
 * 
 * Copyright (C) 2010-2013, University of Applied Sciences Wildau,
 * Telematics Research Group, http://www.tm.th-wildau.de/research-group
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 3 of the
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, see <http://www.gnu.org/licenses>.
 * 
 * Contributors:
 *     University of Applied Sciences Wildau - initial API and implementation
 * 
 * If you are interested in a commercial license please contact us via 
 * e-mail: ralf.vandenhouten@th-wildau.de.
 ******************************************************************************/
package de.thwildau.tm.moses.abnf.io;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
 
/**
 * A {@code Transmitable} interface indicates that a data object can be read and written through
 * {@code DataInput} and {@code DataOutput}. The {@code read} and {@code write} methods process
 * the whole object contents. 
 *
 * @author Thomas Kistel
 * @version $Revision: 762 $
 */
public interface Transmitable {

    /**
     * Reads the whole content of the object from the given {@code DataInput}. 
     * 
     * @param in the {@code DataInput} (may a {@code DataInputStream}
     * @throws IOException if an error occurs
     */
    public void read(DataInput in) throws IOException;
    
    /**
     * Writes the whole content of the object to the given {@code DataOutput}. 
     * 
     * @param out the {@code DataOutput} (may a {@code DataOutputStream}
     * @throws IOException if an error occurs
     */
    public void write(DataOutput out) throws IOException;
}
